package com.liit.front.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.liit.module.frame.utils.HttpClientUtil;

/**
 * @author dingweibo
 * @Title: SearchController.java
 * @Description: 查询搜索
 * @date 2015年12月4日
 */
@Controller
@RequestMapping(value = "/search")
public class SearchController {
	/**
	 * 产品码
	 * 
	 * @return
	 */
	@RequestMapping(value = "/searchCode")
	public String searchCode() {
		IndexController.navigation();
		return "/search/searchCode";
	}

	@RequestMapping(value = "/searchCode/query")
	@ResponseBody
	public Object searchCode(@RequestParam String code) {
		Map<String, String> params = new HashMap<String, String>();
		params.put("action", "GetByIdentifier");
		params.put("Identifier", code);
		return HttpClientUtil.doPost("http://www.wechatpen.com/scode/AjaxWapHandler", params);
	}
}
